package emu;

import java.math.BigDecimal;

public class EnumBehave {
	public static void main(String[] args) {
		System.out.println(EnumData.MUTITYPE.getSum());
		System.err.println(EnumData1.A.goo("hh", "gg"));
	}
}

interface EnumInter {
	String add(String s1, String s2);
}

enum EnumData2 implements EnumInter {
	ADD("a","b") {
		public String add(String s1, String s2) {
			return s1+s2;
		}
	};
	private final String s1;
	private final String s2;
	private EnumData2(String s1,String s2){
		this.s1=s1;
		this.s2=s2;
	}

}

enum EnumData1 {
	A("+") {
		String goo(String s1, String s2) {
			return s1 + s2;
		}
	},
	B("-") {
		String goo(String s1, String s2) {
			return s1 + s2;
		}
	},
	C("*") {
		String goo(String s1, String s2) {
			return s1 + s2;
		}
	},
	D("/") {
		String goo(String s1, String s2) {
			return s1 + s2;
		}
	};
	private final String symbol;

	private EnumData1(String symbol) {
		this.symbol = symbol;
	}

	@Override
	public String toString() {
		return this.symbol;
	}

	abstract String goo(String s1, String s2);
}

enum EnumData {
	MUTITYPE(1, 2, "乘号"), DIVIDE(1, 2, "除号"), ADD(1, 2, "加号"), SUBTRACT(1, 2,
			"减号");
	private Integer i;
	private Integer j;
	private String discription;
	private Integer sum;

	private EnumData(int i, int j, String discription) {
		this.i = i;
		this.j = j;
		this.discription = discription;
	}

	public Integer getSum() {
		System.out.println(this.name());
		switch (this.name()) {
		case "MUTITYPE":
			this.sum = this.i * this.j;
			break;
		case "DIVIDE":
			this.sum = this.i / this.j;
			break;
		case "ADD":
			this.sum = this.i + this.j;
			break;
		case "SUBTRACT":
			this.sum = this.i - this.j;
			break;
		default:
			break;
		}
		return this.sum;
	}

	public String getDiscription() {
		return this.discription;
	}
}
